#MAKEFILE FOR DNS SERVER

#Select your platform (hack to get compilation under BSD, we'll use autotools in the future)
#PLATFORM=LINUX
#PLATFORM=BSD

#modify this for where your libpcap files are
#PCAPLIBS=-I/usr/lib/ -I/usr/include  
#PCAPLINK=-L/usr/lib/  

MAKEFLAGS=-j8
OBJS=../commandLineParser.o ../DnsServerConfiguration.o ../dnsPacket.o ../threads.o ../readerWriterLock.o ../semaphore.o ../mutex.o ../socketServerData.o ../socketServerThread.o ../udpServer.o ../packetBuffer.o ../udpMessage.o ../dnsQuestion.o ../dnsRecord.o ../resolverData.o ../resolverThread.o ../udpMessageQueue.o ../udpSocketServer.o ../IPv6Address.o ../staticBuffer.o
TESTOBJS=main.o staticBufferTest.o
CC=g++
CXXFLAGS=-ggdb -g3 -Wall -D DEFAULT_CONFIG_LOCATION=\"/etc/dns.conf\" -D DEFAULT_VIOLATION_LOG=\"/var/log/dnsViolations.log\"
OPTOMIZE=-O2 -funroll-loops -fprefetch-loop-arrays 
LDFLAGS=-lpthread #-lpcap
#LDTESTFLAGS= $(LDFLAGS) -ldl -lcppunit
DEPEND= makedepend $(CFLAGS)
	
VERSION=$(shell ./version.sh)

unittest: $(OBJS) $(TESTOBJS)
	$(CC) $(LDFLAGS) -o $@ $(OBJS) $(TESTOBJS)

all: unittest 

clean:
	-rm *.o unittest 
